﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VicMessenger.DB;
using VicMessenger.DAL;

namespace VicMessenger.BLL
{
    class CampaignBLL
    {
        public static List<proc_Campaign_SelectResult> GetAllCampaign()
        {
            try
            {
                return CampaignDAL.GetCampaign(null, null);
            }
            catch (Exception)
            {

                return null;
            }
        }

        public static proc_Campaign_SelectResult GetCampaignByID(int prmCampaignID)
        {
            try
            {
                return CampaignDAL.GetCampaign(prmCampaignID, null)[0];
            }
            catch (Exception)
            {

                return null;
            }
        }
        public static List<proc_Campaign_SelectResult> GetCampaignByCategoryId(int prmCategoryId)
        {
            try
            {
                return CampaignDAL.GetCampaign(null, prmCategoryId);
            }
            catch (Exception)
            {

                return null;
            }
        }

        public static int? InsertUpdateCampaign(proc_Campaign_SelectResult prmCampaign)
        {
            try
            {
                return CampaignDAL.InsertUpdateCampaign(prmCampaign);
            }
            catch (Exception)
            {

                return 0;
            }
        }

        public static int? DeleteCampaign(int prmCampaignID)
        {
            try
            {
                return CampaignDAL.DeleteCampaign(prmCampaignID);
            }
            catch (Exception)
            {

                return 0;
            }
        }


    }
}
